package cn.tedu.spring.bean;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestUserDao {
    public static void main(String[] args) {
/*
        // 使用Spring框架创建对象
        ApplicationContext context = new AnnotationConfigApplicationContext(
                "cn.tedu.spring.bean"
        );

        //
        UserDao userDao = context.getBean(UserDao.class);
        System.out.println(userDao);

        // 调用方法
        userDao.run();*/

        ApplicationContext context = new AnnotationConfigApplicationContext(
                "cn.tedu.spring.bean"
        );

        UserService userService = context.getBean(UserService.class);

        System.out.println(userService);


    }
}
